﻿@using Smartstore.Utilities

@{
    var attributes = new AttributeDictionary().Merge(ConvertUtility.ObjectToDictionary(ViewData["htmlAttributes"] ?? new object()));
    var step = GetMetadata<double>("step");
    var invariant = GetMetadata<bool>("invariant");
}

<input type="number"
       asp-for="@Model"
       attrs="attributes"
       sm-decimals="@(GetMetadata<uint?>("decimals") ?? 4)"
       sm-postfix="@(GetMetadata<string>("postfix"))"
       placeholder="@(GetMetadata<string>("placeholder") ?? T("Common.Empty").Value)"
       min="@(GetMetadata<decimal?>("min"))"
       max="@(GetMetadata<decimal?>("max"))"
       attr-step='(step > 0, step.ToStringInvariant())'
       attr-data-invariant='(invariant, "true")' />


